14. Coprocessor 0

14.19 Diagnostic Register (22)


CP0 register 22, the Diagnostic register, is a new 64-bit register for processor-specific diagnostic functions. (Since this register is designed for local use, the diagnostic functions are subject to change without notice.) Currently, this register helps test the ITLB, branch caches, and the branch prediction scheme. In addition, it provides choices for branch prediction algorithms, to help diagnostic program writing.

The ten fields of the Diagnostic register, shown in Figure 14-21, are described below. All fields are read-only (all writes are ignored).

ITLBM: this field is a 4-bit read-only counter. This field is incremented by one for each ITLB miss, and any overflow is ignored. Its value is undefined during reset, and its value is meaningless when used in an unmapped space.

BSIdx: this field defines the entry in the branch stack to be used for the latest conditional branch decoded. Its value is meaningless if the latest branch was an unconditional branch.

DBRC: this field disables the use of the branch return cache (BRC).

BRCV: this field indicates whether or not the branch return cache (BRC) is valid. BRC has only one entry (four instructions).

BRCW: this field indicates whether or not the latest branch (JAL, JALR RX, BGEZAL, BGEZALL, BLTZAL, or BLTZALL) caused a write into BRC. It is not affected by any other type of branch.

BRCH: this field indicates whether or not the latest branch (JR r31 or JALR rx,r31) has a BRC hit. It not affected by any other type of branch.

MP: this field indicates whether or not the latest conditional branch verified was mispredicted.

BPMode: this is a read-write field for branch prediction algorithm control.

002: 2-bit counter scheme

012: all conditional branches are predicted not taken

102: all conditional branches are predicted taken

112: forward conditional branches are predicted not taken and backward conditional branches are predicted taken.

The default mode is 00 on processor reset.

BPState: this field contains the new 2-bit state for a conditional branch after it is verified. It is also used to hold the 2-bit state to read/write when a branch prediction table read/write operation is executed.

BPIdx: this field contains the index to the BPT for BPT read/write/initialization operations, and should contain VA[11:3] of the branch for BPT read/write operations. The upper six bits of the BPIdx field contain the line address for BPT line initialization operations; the lower three bits of BPIdx are ignored.

BPOp: this field indicates the following BPT operations:

002: BPT read

012: BPT write

102: initializes BPT line to all zeroes (strongly not taken)

112: initializes BPT line to all ones (strongly taken).


0: Reserved. Must be written as zeroes, and returns zeroes when read. (See page 224 of Errata.)


Figure 14-21 shows the format of the Diagnostic register.



Figure 14-21 Diagnostic Register Format




Copyright 1995, MIPS Technologies, Inc. -- 29 JAN 96


Generated with CERN WebMaker